{extend name="public/base"}

{block name="main"}
<form action="{:url('/auth')}" class="pb-3">
  <div class="form-row">
    <div class="col-form-label">
      <label for="name">管理员：</label>
    </div>
    <div class="col-auto">
      <input type="text" id="name" name="name" placeholder="查询的管理员" class="form-control">
    </div>
    <div class="col-auto">
      <button class="btn btn-primary">搜索</button>
      <a href="{:url('/auth/create')}" class="btn btn-success">添加管理</a>
    </div>
  </div>
</form>

<!--列表-->
<table class="table table-bordered">
  <thead class="thead-light">
  <tr>
    <th class="text-center">ID</th>
    <th class=>管理员</th>
    <th class=>权限范围</th>
    <th class="text-center">操作</th>
  </tr>
  </thead>
  <tbody>
  {assign name="empty" value='<tr><td colspan="7" class="text-center text-muted">没有数据</td></tr>'}
  {volist name="list" id="obj" empty="$empty"}
  <tr>
    <td class="text-center">{$obj.id}</td>
    <td >{$obj.name}</td>
    <td>{$obj.roles}</td>
    <td class="text-center">
      <form action="{:url('/auth/'.$obj.id)}" method="post">
        <input type="hidden" name="_method" value="delete">
        <button class="btn btn-danger btn-sm btn-delete">删除</button>
        <a href="{:url('/auth/'.$obj.id.'/edit')}" class="btn btn-warning btn-sm">修改</a>
      </form>
    </td>
  </tr>
  {/volist}
  </tbody>
</table>

<!--分页-->
{$list|raw}
{/block}